package com.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class XxController {
    @Value("${server.port}")
    private String port;
    @GetMapping(value = "/hello")
    @ResponseBody
    public String hello(){
        return "端口号是"+port;
    }
    @GetMapping(value = "/TimeOut")
    @ResponseBody
    public String TimeOut(){
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return port;
    }
}
